package com.cute.leetcode.editor.cn.my;

/**
 *  用空格分隔的字符串，求最长子串长度
 */
public class LongestSubstring {
    public static void main(String[] args) {

        String str="a1 123# abc4f 3d";

        String[] array = str.split(" ");
        int maxLength=0;
        for (int i=0;i<array.length;i++){
            if (array[i].length() > maxLength) {
                maxLength = array[i].length();
            }

        }
        System.out.println(maxLength);
    }
}
